home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / batchut / setpgms.zip / NLOG.DOC < prev    next >
Text File  |  1986-12-28  |  5KB  |  123 lines

  1.                           Customizable logging system
  2.  
  3.         Copyright 1986, Arnold B. Krueger Grosse Pointe Woods, MI 48236
  4.       Non-Commerical use permitted. Commercial users: contact ARNY KRUEGER 
  5.                           at EXEC-PC (414-964-5160).
  6.  
  7.  
  8. I have tried many usage logging systems, and have found that they all seem to 
  9. fall short. The NLOG system is my attempt to address the problems I have 
  10. encountered which are:
  11.  
  12.     * Some of my youg operators like to enter garbage into the database
  13.  
  14.     * Collecting log-in time is easy, collecting log-outs is hard because
  15.       operators can just turn the computer off.
  16.  
  17.     * During program development, one can end up booting many times, and
  18.       I wanted to get through log-in ASAP.
  19.  
  20.     * Everybody has their own needs, so I wanted to have something that
  21.       was easy to customize, but needed no special language processors
  22.  
  23. The NLOG system is written in the DOS .BAT language with a few extensions that 
  24. are included in this .ARC file. To install it, you will need to tailor it
  25. some, as this is operational code from my system, and it will take some changes 
  26. to meet your needs.
  27.  
  28. Installation:
  29.  
  30.     I.   Modifying the NLOG.BAT file:
  31.  
  32.          Near the top of the file is the file location customization section.
  33.          logdir  The full name of the directory is where the log files are 
  34.                  kept. 
  35.  
  36.          progdir The full name of the directory where the log programs SETNOW 
  37.                  and SETREAD are found.
  38.  
  39.          rem Customization section start:
  40.          set logdir=c:\$temp
  41.          set progdir=c:\utility\
  42.          rem Customization section end:
  43.  
  44.          Further down is a section where the initials of authorized users of 
  45.          the system are validated. The initials of the users are the 
  46.          capitalized  JSK, DLK, ... etc, below. The z is appended to avoid
  47.          syntax errors if a user replies with just a carriage return.
  48.          Alter this portion of the .BAT file as required by your situation.
  49.  
  50.          :getwho
  51.           echo Enter your initials, then ─┘
  52.           %progdir%setread who /u
  53.           if z%who% == zJSK goto gotwho
  54.           if z%who% == zDLK goto gotwho
  55.           if z%who% == zSAK goto gotwho
  56.           if z%who% == zSLK goto gotwho
  57.           if z%who% == zABK goto gotwho
  58.           echo Only Krueger household initials are accepted, not %who%!!!
  59.           goto getwho
  60.  
  61.          :gotwho
  62.           if %who% == JSK set username=Joe
  63.           if %who% == DLK set username=Dan
  64.           if %who% == SAK set username=Sarah
  65.           if %who% == SLK set username=Sue
  66.           if %who% == ABK set username=Arny
  67.           echo %username%, please type Business or Pleasure (B or P)
  68.  
  69.  
  70.  
  71.     II.  Modifying your AUTOEXEC.BAT file:
  72.  
  73.  
  74.          rem login the usage:
  75.          set progdir=c:\utility\
  76.          %comspec% /e:640 /c=c:\utility\nlog 
  77.  
  78.          The set line duplicates the line you updated in NLOG. In this 
  79.          application, it controls checkpointing (see below).
  80.  
  81.          This %COMSPEC% line is appropriate for DOS 3.2. For DOS 3.1 modify the 
  82.          /e parameter by dividing by 16. In the example this means changing 
  83.          the 640 to 40.
  84.  
  85.     III. Modifying your CONFIG.SYS file:
  86.  
  87.          The NLOG batch file will add some variables to the environment.
  88.          It is recommended that you extend the size of the environment as
  89.          follows:
  90.  
  91.                           SHELL=C:\command.com /p /e:640
  92.  
  93.          Again, this is a DOS 3.2 version. For DOS 3.1 change the 640 to 40
  94.          since DOS 3.1 sizes the environment in paragraphs.  DOS 3.2 sizes
  95.          the environment in bytes.
  96.  
  97.     IV.  Checkpointing. A key concept of this system is that checkpoints
  98.          are taken as people use various .BAT files on your system.
  99.          The checkpoint then contains a fair estimate of the last time of
  100.          use of your computer. If the user logs out explicitly, then the
  101.          checkpoint file is deleted. If he does not, the next time he
  102.          attempts login, he will be prompted to close the previous session.
  103.          He can do this three ways:
  104.  
  105.                 1. Continue the previous session.
  106.                 2. Logout the previous session using checkpoint data
  107.                 3. Logout by typing in new time/date information.
  108.  
  109.  
  110.         The following code should be copied all over the .BAT files on your
  111.         system to ensure the checkpoint files are kept up to date:
  112.  
  113.                     c:\utility\setnow
  114.                     c:\utility\setdir autdir
  115.                     cd %logdir%
  116.                     echo %date% %time% C checkpoint >newlog.log  
  117.                     cd %autdir%
  118.                     set autdir=
  119.  
  120.  
  121.  
  122.  
  123.